<? include("include/session.php");?>
<!DOCTYPE PHP>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Menu - PizzaRio</title>
<link href="CSS/opmaak.css" rel="stylesheet" type="text/css"><!--[if lte IE 7]>
<style>
.content { margin-right: -1px; } /* this 1px negative margin can be placed on any of the columns in this layout with the same corrective effect. */
ul.nav a { zoom: 1; }  /* the zoom property gives IE the hasLayout trigger it needs to correct extra whiltespace between the links */
</style>
<![endif]-->
</head>

<body>

<div class="container">

  <div class="header">
  
  <img src="Images/Header.png">
    
    <!-- end .header--></div>

  <div class="nav">
  
  <? include("nav.html"); ?>
    <!-- end .nav --></div>

<div class="content1">
<h4>Standaard menu van PizzaRio</h4>
<p>Pizza's kunt u bestellen via de pagina <a href="bestellen.php">bestellen</a>.<br />
 U kunt ook bellen met 010-7944801.</p>
 <form method="post"action="samenstellen.php" align="right">
    <p>
<input type="submit" value="Zelf een pizza samenstellen" /></p> <br />
<?
function SQLResultTable($Query)
{
    $link = mysql_connect(localhost, deb46160 , d3e01tGF) or die('Could not connect: ' . mysql_error());      //link met de database
    mysql_select_db(deb46160_PizzaRio) or die('Could not select database');        //selecteer de juiste database
    $Table = "";  //initializeer tabel variable
   
    $Table.= "<table border='1' style=\"border-collapse: collapse;\">"; //Open HTML Table
   
    $Result = mysql_query($Query); //uitvoeren van de query
    if(mysql_error())
    {
        $Table.= "<tr><td>MySQL ERROR: " . mysql_error() . "</td></tr>";
    }
    else
    {
        //header van de tabel met namen van de velden
        $NumFields = mysql_num_fields($Result);
        $Table.= "<tr style=\"background-color: #000066; color: #FFFFFF;\">"; //stijl van de header
        for ($i=0; $i < $NumFields; $i++)
        {    
            $Table.= "<th>" . mysql_field_name($Result, $i) . "</th>";
        }
        $Table.= "</tr>";
   
        //resultaten van de query worden hier in de tabel gezet dmv een loop
        $RowCt = 0; //Row Counter
        while($Row = mysql_fetch_assoc($Result))
        {
            //om en om andere kleur
            if($RowCt++ % 2 == 0) $Style = "background-color: #FFFFFF;"; //stijl 1
            else $Style = "background-color: #F0F0F0;"; //
           
            $Table.= "<tr style=\"$Style\">";
            //Loop door elk veld
            foreach($Row as $field => $value)
            {
                $Table.= "<td>$value</td>";
            }
            $Table.= "</tr>";
        }
        
    }
    $Table.= "</table>";
   
    return $Table;
}

//functie oproepen met volgende statement
echo SQLResultTable("SELECT pizzanaam, omschrijving, prijs FROM pizzas");
 ?>
     <div class="table1">
	
     <!-- end .table1 --></div>
<!-- end .content1 --></div>
  
  		<div class="footer">
			<a href="index.php"><center><p1>Home</p1></center></a>
    	<!-- end .footer --></div>
    
		<div class="footer">
			<a href="overpizzario.php"><center><p1>Over PizzaRio</p1></center></a>    	
		<!-- end .footer --></div>
  
		<div class="footer">
			<a href="vestigingen.php"><center><p1>Vestigingen</p1></center></a>
    	<!-- end .footer --></div>
    
		<div class="footer">
			<a href="voorwaarden.php"><center><p1>Voorwaarden</p1></center></a>
   		<!-- end .footer --></div>
  <!-- end .container --></div>
</body>
</html>